<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="Generator" content="yls">
    <title>信息输入界面</title>

</head>
<body>
<form action="../test" method="post">
<a href='javascript:void(0);' class='close'
   style="height:3em;float: right;margin-right: 5%;padding-top: 8px;">sdsdsd</a>
<ul>
<%for (var i=0;i<clientList.length;i++){
  if(clientList[i].name!=""&&clientList[i].name!=undefined){
//   console.log(clientList[i].name);
%>
    <li><span><%=clientList[i].name%></span><span><input type="submit" value="说话" onclick="saySth(event)" /></span><span><input type="text"/></span> </li>
    <%}%>
<%}%>
</ul>
<input id="hidClientName" name="hidClientName" type="hidden" value=""/>
    <input id="hidSay" name="hidSay" type="hidden" value=""/>
<img src="/images/guoran.png"/>
</form>
<script src="/js/jquery-1.11.3.js" ></script>
<script type="text/javascript">
   function saySth(event){
       event = event ? event : window.event;
       var obj = event.srcElement ? event.srcElement : event.target;
       alert($("span:first",$(obj).parents("li")).text());
       alert($("span:last input",$(obj).parents("li")).val());
       $("#hidClientName").val($("span:first",$(obj).parents("li")).text());
       $("#hidSay").val($("span:last input",$(obj).parents("li")).val());
   }
</script>
</body>